<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html xmlns:mshelp="http://msdn.microsoft.com/mshelp">
<head>
  <title>Active and Passive Modes</title>


  <meta name="generator" content="HelpMaker.net">

  <meta name="keywords" content="Chapter 1,">

  <link rel="stylesheet" type="text/css" href="ms-help://Hx/HxRuntime/HxLink.css">

  <link rel="stylesheet" type="text/css" href="ms-help://Hx/HxRuntime/HxLinkDefault.css">

</head>
<body style="background-color: rgb(255, 255, 255);">
    <table cellpadding="0" cellspacing="0" width="100%">
      <tr>
        <td style="background-image:url(../images/bk_tl.jpg); background-repeat: repeat-x"><img src="../images/space.gif" width=4 height=4></td>
        <td style="background-image:url(../images/bk_t.jpg); background-repeat: repeat-x"><img src="../images/space.gif" width=4 height=4></td>
        <td style="background-image:url(../images/bk_tr.jpg); background-repeat: repeat-x"><img src="../images/space.gif" width=4 height=4></td>
      </tr>
      <tr>
        <td width="4" style="background-image:url(../images/bk_l.jpg); background-repeat: repeat-y"><img src="../images/space.gif" width=4 height=4></td>
        <td width="100%" style="font-family: sans-serif; font-weight: bold; font-size: 14pt; background-image:url(../images/bk_c.jpg); background-repeat: repeat">
          &nbsp;Active and Passive Modes
        </td>
        <td width="4" style="background-image:url(../images/bk_r.jpg); background-repeat: repeat-y"><img src="../images/space.gif" width=4 height=4></td>
      </tr>
      <tr>
        <td height="4" style="background-image:url(../images/bk_bl.jpg); background-repeat: repeat-x"><img src="../images/space.gif" width=4 height=4></td>
        <td style="background-image:url(../images/bk_b.jpg); background-repeat: repeat-x"><img src="../images/space.gif" width=4 height=4></td>
        <td style="background-image:url(../images/bk_br.jpg); background-repeat: repeat-x"><img src="../images/space.gif" width=4 height=4></td>
      </tr>
    </table>
<br>
<div align="left"><font face="Arial"><span style="font-size: 10pt;">Data connections may be set up in
two different ways, active and passive. Note that active
and passive refer to the operation of the FTP server, not the client.</span></font><br>

</div>

<div align="left"><br>

</div>

<div align="left"><font face="Arial"><span style="font-size: 10pt;"><b>Passive
mode</b></span></font>
</div>

<div align="left"><br>

</div>

<div align="left"><font face="Arial"><span style="font-size: 10pt;">In
passive mode, the client sends a PASV command to the server. This tells
the server to
listen for a connection attempt from the client, hence the server is
passively waiting. The
server replies to PASV with the host and port address that the server
is listening on. The client
deciphers this reply and when a data connection is required, attempts
to initiate the connection
to the server at this address.</span></font>
</div>

<div align="left"><br>

</div>

<div align="left"><font face="Arial"><span style="font-size: 10pt;"><b>Active
mode</b></span></font>
</div>

<div align="left"><br>

</div>

<div align="left"><font face="Arial"><span style="font-size: 10pt;">In
active mode, the server actively connects to the client. To set up
active mode, the client
sends a PORT command to the server, specify the address and port number
the client is
listening on. When a data connection is required, the server initiates
a connection to the client
at this address.</span></font></div>

<div align="left"><br>

</div>

<div align="left"><font face="Arial"><span style="font-size: 10pt;">Generally
the server is responsible for closing data connections.</span></font>
</div>

<div align="left"><br>

</div>

<div align="left"><font face="Arial"><span style="font-size: 10pt;">Next:
</span></font><a href="ftpcommands.html"><font color="#0000ff" face="Arial"><span style="font-size: 10pt;"><u>FTP Commands</u></span></font></a></div>

</body>
</html>
